(function() {

    detect_size();
    LM.page = document.getElementById("lomoo")

    if (typeof LM.pic.id == "undefined") {
        return;
    }

    var size = 'm';

    size = (LM.width > 960 && LM.height > 720) ? 'l' : 'm';
    LM.page.style.background = "#000 url(/picture/" + LM.pic.id + "_" + size + ".jpg) no-repeat scroll center top";

})();

// http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
function detect_size() {
    var width = 0, height = 0;

    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        width = window.innerWidth;
        height = window.innerHeight;
    } else if( document.documentElement &&
               ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        width = document.documentElement.clientWidth;
        height = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        width = document.body.clientWidth;
        height = document.body.clientHeight;
    }
    LM.width = width;
    LM.height = height;
}
